package zheng;

import java.util.Scanner;

public class 判周几 {
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		int y, m, d, m2, i, j = 0, q = 0;
		System.out.println("请输入年份：");
		y = a.nextInt();
		System.out.println("请输入月份：");
		m = a.nextInt();
		System.out.println("请输入天数：");
		d = a.nextInt();

		// 前几年天数
		for (i = 1900; i < y; i++) {
			if (i % 400 == 0 || i % 4 == 0 && i % 100 != 0) {
				j += 366;
			} else {
				j += 365;
			}
		}

		// 当前年份，前几月
		for (int k = 1; k < m; k++) {

			switch (k) {
			case 2:
				if (y % 400 == 0 || y % 4 == 0 && y % 100 != 0) {
					j = j + 29;
				} else {
					j = j + 28;
				}
				break;
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				j = j + 31;
				break;
			case 4:
			case 6:
			case 9:
			case 11:
				j = j + 30;
				break;
			}
		}
		System.out.println(q = j + d);

		
		int f;
		f = q % 7;
		switch (f) {
		case 0:
			System.out.println("星期天");
			break;
		case 1:
			System.out.println("星期一");
			break;
		case 2:
			System.out.println("星期二");
			break;
		case 3:
			System.out.println("星期三");
			break;
		case 4:
			System.out.println("星期四");
			break;
		case 5:
			System.out.println("星期五");
			break;
		case 6:
			System.out.println("星期六");
			break;
		}

	}
}
